package com.dgw.springbootmail.entity;


/**
 * @program: springboot-sendmail
 * @description:
 * @author: Mr.Dai
 * @create: 2020-02-29 21:05
 **/
public class User {

    private final Long id;
    private final String username;
    private final String password;

    public User() {
        this.id = 0L;
        this.username = null;
        this.password = null;
    }

    private User(Long id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }

    public User.UserBuilder builder(){
        return new User.UserBuilder();
    }

    public static class UserBuilder{
        private Long id;
        private String username;
        private String password;

        public UserBuilder() {
        }

        public User.UserBuilder setId(Long id){
            this.id=id;
            return this;
        }
        public User.UserBuilder setUsername(String username){
            this.username=username;
            return this;
        }
        public User.UserBuilder setPassword(String password){
            this.password=password;
            return this;
        }

        public User builder(){
            return new User(id,username,password);
        }
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
